package com.jhgsys.internal.workflow.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jhgsys.internal.common.entity.QueryRequest;
import com.jhgsys.internal.workflow.dto.WorkflowSaveRequestDto;
import com.jhgsys.internal.workflow.entity.WorkflowInfo;
import org.springframework.transaction.annotation.Transactional;

import java.io.IOException;
import java.util.List;

/**
 * 流程信息表 Service接口
 *
 * @author fenghaijun
 * @date 2024-07-15 17:34:52
 */
public interface IWorkflowInfoService extends IService<WorkflowInfo> {
    /**
     * 查询（分页）
     * @author fenghaijun
     * @date 2024-07-15 17:34:52
     * @param request QueryRequest
     * @param workflowInfo workflowInfo
     * @return IPage<WorkflowInfo>
     */
    IPage<WorkflowInfo> findWorkflowInfos(QueryRequest request, WorkflowInfo workflowInfo);

    /**
     * 查询（所有）
     * @author fenghaijun
     * @date 2024-07-15 17:34:52
     * @param workflowInfo workflowInfo
     * @return List<WorkflowInfo>
     */
    List<WorkflowInfo> findWorkflowInfos(WorkflowInfo workflowInfo);

    /**
    * 根据ID查询
    * @author fenghaijun
    * @date 2024-07-15 17:34:52
    * @param id
    * @return WorkflowInfo
    */
    WorkflowInfo findWorkflowInfoById(String id);

    /**
     * 新增
     * @author fenghaijun
     * @date 2024-07-15 17:34:52
     * @param workflowInfo workflowInfo
     */
    void createWorkflowInfo(WorkflowInfo workflowInfo);

    /**
     * 修改
     * @author fenghaijun
     * @date 2024-07-15 17:34:52
     * @param workflowInfo workflowInfo
     */
    void updateWorkflowInfo(WorkflowInfo workflowInfo);

    /**
     * 逻辑删除
     * @author fenghaijun
     * @date 2024-07-15 17:34:52
     * @param workflowInfo workflowInfo
     * @param workflowInfoIds workflowInfoIds
     */
    void deleteWorkflowInfo(WorkflowInfo workflowInfo,String workflowInfoIds);

    /**
    * 物理删除
    * @author fenghaijun
    * @date 2024-07-15 17:34:52
    * @param workflowInfoIds workflowInfoIds
    */
    void physicallyDeleteWorkflowInfo(String workflowInfoIds);

    /**
     * 保存工作流配置
     * @param workflowSaveRequest
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    boolean workflowSave(WorkflowSaveRequestDto workflowSaveRequest)throws IOException;
}
